package com.newenergy.wisehome.data.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;


/**
 * Created by jnl on 2017/9/25.
 */

@DatabaseTable(tableName = "tb_secne_mode")
public class SecneMode implements Parcelable {
    @DatabaseField(generatedId = true)
    private int id;
    @DatabaseField(columnName = "name")
    private String name;
    @DatabaseField(columnName = "familyId")
    private String familyId;
    @DatabaseField(columnName = "isChecked")
    private boolean isChecked = false;

    @DatabaseField(columnName = "iconName")
    private String iconName = "icon_paty1";

    public SecneMode() {
    }

    public SecneMode(String name, String familyId, boolean isChecked) {
        this.name = name;
        this.familyId = familyId;
        this.isChecked = isChecked;
    }
    public SecneMode(String name, String familyId, String iconName) {
        this.name = name;
        this.familyId = familyId;
        this.iconName = iconName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFamilyId() {
        return familyId;
    }

    public void setFamilyId(String familyId) {
        this.familyId = familyId;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public void setIconName(String iconName) {
        this.iconName = iconName;
    }

    public String getIconName() {
        return iconName;
    }

    @Override
    public String toString() {
        return "SecneMode{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", familyId=" + familyId +
                ", isChecked=" + isChecked +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeString(this.familyId);
        dest.writeByte(this.isChecked ? (byte) 1 : (byte) 0);
        dest.writeString(this.iconName);
    }

    protected SecneMode(Parcel in) {
        this.id = in.readInt();
        this.name = in.readString();
        this.familyId = in.readString();
        this.isChecked = in.readByte() != 0;
        this.iconName = in.readString();
    }

    public static final Parcelable.Creator<SecneMode> CREATOR = new Parcelable.Creator<SecneMode>() {
        @Override
        public SecneMode createFromParcel(Parcel source) {
            return new SecneMode(source);
        }

        @Override
        public SecneMode[] newArray(int size) {
            return new SecneMode[size];
        }
    };
}
